home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Tools (InfoMagic)
/
Internet Tools.iso
/
dos_win
/
winsock
/
hacklist
/
94-04.Z
/
94-04
/
000009_rcq@mailserv-D.ftp.com_Sat Apr 9 07:28:42 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-04-30
|
2KB
Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
id AB01300; Sat, 9 Apr 1994 11:29:38 -0400
Received: from ftp.com by ftp.com ; Sat, 9 Apr 1994 11:29:37 -0400
Received: from mailserv-D.ftp.com by ftp.com ; Sat, 9 Apr 1994 11:29:37 -0400
Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
id AA19993; Sat, 9 Apr 94 11:28:42 EDT
Date: Sat, 9 Apr 94 11:28:42 EDT
Message-Id: <9404091528.AA19993@mailserv-D.ftp.com>
To: bryan@alex.com
Subject: Re: Closing and reusing sockets
From: rcq@ftp.com (Bob Quinn)
Reply-To: rcq@ftp.com
Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
Sender: rcq@mailserv-D.ftp.com
Repository: mailserv-D.ftp.com, [message accepted at Sat Apr 9 11:28:18 1994]
Originating-Client: hurricane.ftp.com
Content-Length: 1155
> Aha! I was working on the assumption that EADDRINUSE referred to the
> *local* address, not the remote address. The spec doesn't specify --
> is there any other explicit reference? I see that Stevens "Unix Network
> Programming" does use it as you describe in the rcmd example, page 570.
A socket is identified by what Stevens calls the 5-tuple:
- Protocol
- Local IP address
- Local Port Number
- Remote IP address
- Remote Port Number
You get a WSAEADDRINUSE iff *all 5* elements match between two sockets.
The reason doing a bind() on a client is not recommended is because
commonly the one thing that differs in subsequent connections
between a client and *the same* server is the local port number on
a client socket. Servers *must* bind() to the same port number each
time, because the port number identifies their service. Clients
typically need not bind() to a port, since an arbitrary port number
is typically acceptable. RSH and LPR are two of the few exceptions.
Regards,
--
Bob Quinn rcq@ftp.com
FTP Software, Inc. No. Andover, MA